package com.wo.cloud.admin.service.impl;

import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.wo.cloud.admin.entity.SysPermission;
import com.wo.cloud.admin.mapper.SysPermissionMapper;
import com.wo.cloud.admin.service.IPermissionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author liry
 * @version 1.0
 * @date Created on 2021/5/15 22:45
 * Description:
 */

@Service
public class SysPermissionServiceImpl extends ServiceImpl<SysPermissionMapper, SysPermission> implements IPermissionService {

    @Autowired
    private SysPermissionMapper permissionMapper;

    @Override
    public IPage<SysPermission> selectPage(Page page, String name) {
        QueryWrapper<SysPermission> wrapper = new QueryWrapper<>();
        wrapper.like(StrUtil.isNotBlank(name), "name", name);

        return permissionMapper.selectPage(page, wrapper);
    }
}
